home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / WASTE 1.2 / WASTE C⁄C++ Headers / WASTE.h < prev   
Text File  |  1996-06-25  |  36KB  |  794 lines

  1. /*
  2.  *    WASTE.h
  3.  *
  4.  *    C/C++ interface to the WASTE text engine
  5.  *
  6.  *    version 1.2 (June 1996)
  7.  *
  8.  *    Copyright (c) 1993-1996 Marco Piovanelli
  9.  *    All Rights Reserved
  10.  * 
  11.  */
  12.  
  13. #ifndef _WASTE_
  14. #define _WASTE_
  15.  
  16. #ifndef __CONDITIONALMACROS__
  17. #include <ConditionalMacros.h>
  18. #endif
  19.  
  20. #ifndef __TYPES__
  21. #include <Types.h>
  22. #endif
  23.  
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAWTEXT__
  29. #include <QuickdrawText.h>
  30. #endif
  31.  
  32. #ifndef __QUICKDRAW__
  33. #include <Quickdraw.h>
  34. #endif
  35.  
  36. #ifndef __SCRIPT__
  37. #include <Script.h>
  38. #endif
  39.  
  40. #ifndef __TEXTUTILS__
  41. #include <TextUtils.h>
  42. #endif
  43.  
  44. #ifndef __TEXTEDIT__
  45. #include <TextEdit.h>
  46. #endif
  47.  
  48. #ifndef __DRAG__
  49. #include <Drag.h>
  50. #endif
  51.  
  52. #ifndef __LONGCOORDINATES__
  53. #ifndef _LongCoords_
  54. #include "LongCoords.h"
  55. #endif
  56. #endif
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61.  
  62. #if PRAGMA_ALIGN_SUPPORTED
  63. #pragma options align=mac68k
  64. #endif
  65.  
  66. #if PRAGMA_IMPORT_SUPPORTED
  67. #pragma import on
  68. #endif
  69.  
  70. // if we're using a pre-2.1 version of the Universal Headers, define EventModifiers
  71. #ifndef UNIVERSAL_INTERFACES_VERSION
  72. typedef UInt16 EventModifiers;
  73. #endif
  74.  
  75. //    The macro WASTE_VERSION expands to the current version of WASTE,
  76. //    expressed in standard NumVersion format (see Types.h)
  77. //    The macro WASTE11 is obsolete but still supported for backward
  78. //    compatibility
  79.  
  80. #define WASTE_VERSION    0x01208000
  81. #define WASTE11
  82.  
  83. /*    result codes */
  84.  
  85. enum {
  86.     weCantUndoErr            =    -10015,    /* undo buffer is clear (= errAECantUndo) */
  87.     weEmptySelectionErr        =    -10013,    /* selection range is empty (= errAENoUserSelection) */
  88.     weNotHandledErr            =    -1708,    /* please use default behavior (= errAEEventNotHandled) */
  89.     weUnknownObjectTypeErr    =    -9478,    /* specified object type is not registered */
  90.     weObjectNotFoundErr        =    -9477,    /* no object found at specified offset */
  91.     weReadOnlyErr            =    -9476,    /* instance is read-only */
  92.     weUndefinedSelectorErr    =    -50        /* unknown selector (= paramErr) */
  93. };
  94.  
  95. /*    alignment styles */
  96.  
  97. enum {
  98.     weFlushLeft         =    -2,        /* flush left */
  99.     weFlushRight        =    -1,        /* flush right */
  100.     weFlushDefault        =     0,        /* flush according to system direction */
  101.     weCenter            =     1,        /* centered */
  102.     weJustify            =     2        /* fully justified */
  103. };
  104.  
  105. /*    values for the mode parameter in WESetStyle and WEContinuousStyle */
  106.  
  107. enum {
  108.     weDoFont                =    0x0001,
  109.     weDoFace                =    0x0002,
  110.     weDoSize                =    0x0004,
  111.     weDoColor                =    0x0008,
  112.     weDoAll                    =    weDoFont + weDoFace + weDoSize + weDoColor,
  113.     weDoAddSize                =    0x0010,
  114.     weDoToggleFace            =    0x0020,
  115.     weDoReplaceFace            =    0x0040,
  116.     weDoPreserveScript        =    0x0080,
  117.     weDoExtractSubscript    =    0x0100,
  118.     weDoFaceMask            =    0x0200
  119. };
  120.  
  121. /*    values for the edge parameter in WEGetOffset etc. */
  122.  
  123. enum {
  124.     kLeadingEdge = -1,        /* point is on the leading edge of a glyph */
  125.     kTrailingEdge = 0,        /* point is on the trailing edge of a glyph */
  126.     kObjectEdge = 2            /* point is in the middle of an embedded object */
  127. };
  128.  
  129. /*    values for WEFeatureFlag feature parameter */
  130.  
  131. enum {
  132.     weFAutoScroll        =    0,        /* automatically scroll the selection range into view */
  133.     weFOutlineHilite    =    2,        /* frame selection when deactivated */
  134.     weFReadOnly            =    5,        /* disallow modifications */
  135.     weFUndo                =    6,        /* support WEUndo() */
  136.     weFIntCutAndPaste    =    7,        /* use intelligent cut-and-paste rules */
  137.     weFDragAndDrop        =    8,        /* support drag-and-drop text editing */
  138.     weFInhibitRecal        =    9,        /* don't recalculate line starts and don't redraw text */
  139.     weFUseTempMem        =    10,        /* use temporary memory for main data structures */
  140.     weFDrawOffscreen    =    11,        /* draw text offscreen for smoother visual results */
  141.     weFInhibitRedraw    =    12,        /* don't redraw text */
  142.     weFMonoStyled        =    13,        /* disallow style changes */
  143.     weFInhibitColor        =    31        /* draw in black & white only */
  144. };
  145.  
  146. /*    values for WENew flags parameter */
  147.  
  148. enum {
  149.     weDoAutoScroll        =    1L << weFAutoScroll,
  150.     weDoOutlineHilite    =    1L << weFOutlineHilite,
  151.     weDoReadOnly        =    1L << weFReadOnly,
  152.     weDoUndo            =    1L << weFUndo,
  153.     weDoIntCutAndPaste    =    1L << weFIntCutAndPaste,
  154.     weDoDragAndDrop        =    1L << weFDragAndDrop,
  155.     weDoInhibitRecal    =    1L << weFInhibitRecal,
  156.     weDoUseTempMem        =    1L << weFUseTempMem,
  157.     weDoDrawOffscreen    =    1L << weFDrawOffscreen,
  158.     weDoInhibitRedraw    =    1L << weFInhibitRedraw,
  159.     weDoMonoStyled        =    1L << weFMonoStyled,
  160.     weDoInhibitColor    =    1L << weFInhibitColor
  161. };
  162.  
  163. /*    values for WEFeatureFlag action parameter */
  164.  
  165. enum {
  166.     weBitToggle = -2,    /* toggles the specified feature */
  167.     weBitTest,            /* returns the current setting of the specified feature */
  168.     weBitClear,            /* disables the specified feature */
  169.     weBitSet            /* enables the specified feature */
  170. };
  171.  
  172. /*    selectors for WEGetInfo and WESetInfo */
  173.  
  174. enum {
  175.     weCharByteHook            =    'cbyt', /* CharByte hook */
  176.     weCharToPixelHook        =    'c2p ',    /* CharToPixel hook */
  177.     weCharTypeHook            =    'ctyp', /* CharType hook */
  178.     weClickLoop                =    'clik',    /* click loop callback */
  179.     weCurrentDrag            =    'drag',    /* drag currently being tracked from WEClick() */
  180.     weDrawTextHook            =    'draw', /* text drawing hook */
  181.     weHiliteDropAreaHook    =    'hidr', /* drop area highlighting hook */
  182.     weLineBreakHook            =    'lbrk',    /* line breaking hook */
  183.     wePixelToCharHook        =    'p2c ', /* PixelToChar hook */
  184.     wePort                    =    'port',    /* graphics port */
  185.     weRefCon                =    'refc',    /* reference constant for use by application */
  186.     weScrollProc            =    'scrl',    /* auto-scroll callback */
  187.     weText                    =    'text',    /* text handle */
  188.     weTranslateDragHook     =    'xdrg', /* drag translation callback */
  189.     weTSMDocumentID            =    'tsmd',    /* Text Services Manager document ID */
  190.     weTSMPreUpdate            =    'pre ',    /* Text Services Manager pre-update callback */
  191.     weTSMPostUpdate            =    'post',    /* Text Services Manager post-update callback */
  192.     weURLHint                =    'urlh',    /* URL hint string for Internet Config */
  193.     weWordBreakHook            =    'wbrk'    /* word breaking hook */
  194. };
  195.  
  196. /*    values for WEInstallObjectHandler handlerSelector parameter */
  197.  
  198. enum {
  199.     weNewHandler        =    'new ',        /* new handler */
  200.     weDisposeHandler    =    'free',        /* dispose handler */
  201.     weDrawHandler        =    'draw',        /* draw handler */
  202.     weClickHandler        =    'clik',        /* click handler */
  203.     weStreamHandler        =    'strm'        /* stream handler */
  204. };
  205.  
  206. /*    action kinds */
  207.  
  208. enum {
  209.     weAKNone            =    0,        /* null action */
  210.     weAKUnspecified        =    1,        /* action of unspecified nature */
  211.     weAKTyping            =    2,        /* some text has been typed in */
  212.     weAKCut                =    3,        /* the selection range has been cut */
  213.     weAKPaste            =    4,        /* something has been pasted */
  214.     weAKClear            =    5,        /* the selection range has been deleted */
  215.     weAKDrag            =    6,        /* drag and drop operation */
  216.     weAKSetStyle        =    7        /* some style has been applied to a text range */
  217. };
  218.  
  219. /*    destination kinds for stream handler */
  220.  
  221. enum {
  222.     weToScrap            =    0,
  223.     weToDrag            =    1,
  224.     weToSoup            =    2
  225. };
  226.  
  227. typedef struct OpaqueWEReference *WEReference;
  228. typedef struct OpaqueWEObjectReference *WEObjectReference;
  229. typedef Handle WESoupHandle;
  230. typedef SInt16 WEActionKind;
  231. typedef SInt8 WEAlignment;
  232. typedef SInt8 WEEdge;
  233. typedef UInt16 WEStyleMode;
  234. typedef FourCharCode WESelector;
  235. typedef WEReference WEHandle;    /* obsolete, kept for backward compatibility */
  236.  
  237. typedef struct WERunInfo {
  238.     SInt32                 runStart;    /* byte offset to first character of style run */
  239.     SInt32                 runEnd;        /* byte offset past last character of style run */
  240.     SInt16                 runHeight;    /* line height (ascent + descent + leading) */
  241.     SInt16                 runAscent;    /* font ascent */
  242.     TextStyle             runStyle;    /* text attributes */
  243.     WEObjectReference    runObject;    /* either nil or reference to embedded object */
  244. } WERunInfo;
  245.  
  246.  
  247. /*    callback prototypes */
  248.  
  249. typedef pascal Boolean (*WEClickLoopProcPtr)(WEReference we);
  250. typedef pascal void (*WEScrollProcPtr)(WEReference we);
  251. typedef pascal void (*WETSMPreUpdateProcPtr)(WEReference we);
  252. typedef pascal void (*WETSMPostUpdateProcPtr)(WEReference we,
  253.         SInt32 fixLength, SInt32 inputAreaStart, SInt32 inputAreaEnd,
  254.         SInt32 pinRangeStart, SInt32 pinRangeEnd);
  255. typedef pascal OSErr (*WETranslateDragProcPtr)(DragReference theDrag,
  256.         ItemReference theItem, FlavorType requestedType, Handle putDataHere);
  257. typedef pascal OSErr (*WEHiliteDropAreaProcPtr)(DragReference theDrag,
  258.         Boolean hiliteFlag, WEReference we);
  259. typedef pascal void (*WEDrawTextProcPtr)(Ptr pText, SInt32 textLength, Fixed slop,
  260.         JustStyleCode styleRunPosition, WEReference we);
  261. typedef pascal SInt32 (*WEPixelToCharProcPtr)(Ptr pText, SInt32 textLength, Fixed slop,
  262.         Fixed *pixelWidth, WEEdge *edge, JustStyleCode styleRunPosition, Fixed hPos, WEReference we);
  263. typedef pascal SInt16 (*WECharToPixelProcPtr)(Ptr pText, SInt32 textLength, Fixed slop,
  264.         SInt32 offset, SInt16 direction, JustStyleCode styleRunPosition, SInt32 hPos, WEReference we);
  265. typedef pascal StyledLineBreakCode (*WELineBreakProcPtr)(Ptr pText, SInt32 textLength,
  266.         SInt32 textStart, SInt32 textEnd, Fixed *textWidth, SInt32 *textOffset, WEReference we);
  267. typedef pascal void (*WEWordBreakProcPtr)(Ptr pText, SInt16 textLength, SInt16 offset,
  268.         WEEdge edge, OffsetTable breakOffsets, ScriptCode script, WEReference we);
  269. typedef pascal SInt16 (*WECharByteProcPtr)(Ptr pText, SInt16 textOffset, ScriptCode script,
  270.         WEReference we);
  271. typedef pascal SInt16 (*WECharTypeProcPtr)(Ptr pText, SInt16 textOffset, ScriptCode script, WEReference we);
  272. typedef pascal OSErr (*WENewObjectProcPtr)(Point *defaultObjectSize,
  273.         WEObjectReference obj);
  274. typedef pascal OSErr (*WEDisposeObjectProcPtr)(WEObjectReference obj);
  275. typedef pascal OSErr (*WEDrawObjectProcPtr)(const Rect *destRect,
  276.         WEObjectReference obj);
  277. typedef pascal Boolean (*WEClickObjectProcPtr)(Point hitPt, EventModifiers modifiers, UInt32 clickTime,
  278.         WEObjectReference obj);
  279. typedef pascal OSErr (*WEStreamObjectProcPtr)(SInt16 destKind, FlavorType *theType,
  280.         Handle putDataHere, WEObjectReference obj);
  281.  
  282.  
  283. /*    UPP proc info */
  284.  
  285. enum {
  286.     uppWEClickLoopProcInfo = kPascalStackBased
  287.         | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  288.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  289. };
  290. enum {
  291.     uppWEScrollProcInfo = kPascalStackBased
  292.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  293. };
  294. enum {
  295.     uppWETSMPreUpdateProcInfo = kPascalStackBased
  296.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  297. };
  298. enum {
  299.     uppWETSMPostUpdateProcInfo = kPascalStackBased
  300.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  301.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt32 /*fixLength*/)))
  302.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(SInt32 /*inputAreaStart*/)))
  303.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(SInt32 /*inputAreaEnd*/)))
  304.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(SInt32 /*pinRangeStart*/)))
  305.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(SInt32 /*pinRangeEnd*/)))
  306. };
  307. enum {
  308.     uppWETranslateDragProcInfo = kPascalStackBased
  309.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  310.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(DragReference /*theDrag*/)))
  311.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(ItemReference /*theItem*/)))
  312.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(FlavorType /*requestedType*/)))
  313.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(Handle /*putDataHere*/)))
  314. };
  315. enum {
  316.     uppWEHiliteDropAreaProcInfo = kPascalStackBased
  317.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  318.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(DragReference /*theDrag*/)))
  319.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(Boolean /*hiliteFlag*/)))
  320.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(WEReference /*we*/)))
  321. };
  322. enum {
  323.     uppWEDrawTextProcInfo = kPascalStackBased
  324.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  325.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt32 /*textLength*/)))
  326.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Fixed /*slop*/)))
  327.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(JustStyleCode /*styleRunPosition*/)))
  328.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(WEReference /*we*/)))
  329. };
  330. enum {
  331.     uppWEPixelToCharProcInfo = kPascalStackBased
  332.         | RESULT_SIZE(SIZE_CODE(sizeof(SInt32)))
  333.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  334.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt32 /*textLength*/)))
  335.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Fixed /*slop*/)))
  336.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(Fixed * /*pixelWidth*/)))
  337.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(WEEdge * /*edge*/)))
  338.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(JustStyleCode /*styleRunPosition*/)))
  339.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(Fixed /*hPos*/)))
  340.         | STACK_ROUTINE_PARAMETER(8,SIZE_CODE(sizeof(WEReference /*we*/)))
  341. };
  342. enum {
  343.     uppWECharToPixelProcInfo = kPascalStackBased
  344.         | RESULT_SIZE(SIZE_CODE(sizeof(SInt16)))
  345.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  346.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt32 /*textLength*/)))
  347.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Fixed /*slop*/)))
  348.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(SInt32 /*offset*/)))
  349.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(SInt16 /*direction*/)))
  350.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(JustStyleCode /*styleRunPosition*/)))
  351.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(SInt32 /*hPos*/)))
  352.         | STACK_ROUTINE_PARAMETER(8,SIZE_CODE(sizeof(WEReference /*we*/)))
  353. };
  354. enum {
  355.     uppWELineBreakProcInfo = kPascalStackBased
  356.         | RESULT_SIZE(SIZE_CODE(sizeof(StyledLineBreakCode )))
  357.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  358.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt32 /*textLength*/)))
  359.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(SInt32 /*textStart*/)))
  360.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(SInt32 /*textEnd*/)))
  361.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(Fixed * /*textWidth*/)))
  362.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(SInt32 * /*textOffset*/)))
  363.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(WEReference /*we*/)))
  364. };
  365. enum {
  366.     uppWEWordBreakProcInfo = kPascalStackBased
  367.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  368.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt16 /*textLength*/)))
  369.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(SInt16 /*offset*/)))
  370.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEEdge /*edge*/)))
  371.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(OffsetTable * /*breakOffsets*/)))
  372.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(ScriptCode /*script*/)))
  373.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(WEReference /*we*/)))
  374. };
  375. enum {
  376.     uppWECharByteProcInfo = kPascalStackBased
  377.         | RESULT_SIZE(SIZE_CODE(sizeof(SInt16 )))
  378.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  379.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt16 /*textOffset*/)))
  380.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(ScriptCode /*script*/)))
  381.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEReference /*we*/)))
  382. };
  383. enum {
  384.     uppWECharTypeProcInfo = kPascalStackBased
  385.         | RESULT_SIZE(SIZE_CODE(sizeof(SInt16 )))
  386.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  387.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(SInt16 /*textOffset*/)))
  388.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(ScriptCode /*script*/)))
  389.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEReference /*we*/)))
  390. };
  391.  
  392.  
  393. enum {
  394.     uppWENewObjectProcInfo = kPascalStackBased
  395.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  396.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Point * /*defaultObjectSize*/)))
  397.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  398. };
  399. enum {
  400.     uppWEDisposeObjectProcInfo = kPascalStackBased
  401.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  402.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  403. };
  404. enum {
  405.     uppWEDrawObjectProcInfo = kPascalStackBased
  406.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  407.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(const Rect * /*destRect*/)))
  408.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  409. };
  410. enum {
  411.     uppWEClickObjectProcInfo = kPascalStackBased
  412.         | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  413.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Point /*hitPt*/)))
  414.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(EventModifiers /*modifiers*/)))
  415.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(UInt32 /*clickTime*/)))
  416.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  417. };
  418. enum {
  419.     uppWEStreamObjectProcInfo = kPascalStackBased
  420.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  421.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SInt16 /*destKind*/)))
  422.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FlavorType * /*theType*/)))
  423.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Handle /*putDataHere*/)))
  424.         | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  425. };
  426.  
  427.  
  428. /*    UPPs, New≈Proc macros & Call≈Proc macros */
  429.  
  430. /*
  431.     NOTE:
  432.     For compatibility with the Pascal version, Call≈Proc macros take the form:
  433.  
  434.         CallFooProc(..., userRoutine)
  435.  
  436.     instead of:
  437.  
  438.         CallFooProc(userRoutine, ...)
  439.  
  440. */
  441.  
  442. #if GENERATINGCFM
  443.  
  444. typedef UniversalProcPtr WEClickLoopUPP;
  445. typedef UniversalProcPtr WEScrollUPP;
  446. typedef UniversalProcPtr WETSMPreUpdateUPP;
  447. typedef UniversalProcPtr WETSMPostUpdateUPP;
  448. typedef UniversalProcPtr WETranslateDragUPP;
  449. typedef UniversalProcPtr WEHiliteDropAreaUPP;
  450. typedef UniversalProcPtr WEDrawTextUPP;
  451. typedef UniversalProcPtr WEPixelToCharUPP;
  452. typedef UniversalProcPtr WECharToPixelUPP;
  453. typedef UniversalProcPtr WELineBreakUPP;
  454. typedef UniversalProcPtr WEWordBreakUPP;
  455. typedef UniversalProcPtr WECharByteUPP;
  456. typedef UniversalProcPtr WECharTypeUPP;
  457. typedef UniversalProcPtr WENewObjectUPP;
  458. typedef UniversalProcPtr WEDisposeObjectUPP;
  459. typedef UniversalProcPtr WEDrawObjectUPP;
  460. typedef UniversalProcPtr WEClickObjectUPP;
  461. typedef UniversalProcPtr WEStreamObjectUPP;
  462.  
  463. #define NewWEClickLoopProc(userRoutine) \
  464.     (WEClickLoopUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEClickLoopProcInfo, GetCurrentArchitecture())
  465. #define NewWEScrollProc(userRoutine) \
  466.     (WEScrollUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEScrollProcInfo, GetCurrentArchitecture())
  467. #define NewWETSMPreUpdateProc(userRoutine) \
  468.     (WETSMPreUpdateUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWETSMPreUpdateProcInfo, GetCurrentArchitecture())
  469. #define NewWETSMPostUpdateProc(userRoutine) \
  470.     (WETSMPostUpdateUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWETSMPostUpdateProcInfo, GetCurrentArchitecture())
  471. #define NewWETranslateDragProc(userRoutine) \
  472.     (WETranslateDragUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWETranslateDragProcInfo, GetCurrentArchitecture())
  473. #define NewWEHiliteDropAreaProc(userRoutine) \
  474.     (WEHiliteDropAreaUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEHiliteDropAreaProcInfo, GetCurrentArchitecture())
  475. #define NewWEDrawTextProc(userRoutine) \
  476.     (WEDrawTextUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEDrawTextProcInfo, GetCurrentArchitecture())
  477. #define NewWEPixelToCharProc(userRoutine) \
  478.     (WEPixelToCharUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEPixelToCharProcInfo, GetCurrentArchitecture())
  479. #define NewWECharToPixelProc(userRoutine) \
  480.     (WECharToPixelUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWECharToPixelProcInfo, GetCurrentArchitecture())
  481. #define NewWELineBreakProc(userRoutine) \
  482.     (WELineBreakUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWELineBreakProcInfo, GetCurrentArchitecture())
  483. #define NewWEWordBreakProc(userRoutine) \
  484.     (WEWordBreakUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEWordBreakProcInfo, GetCurrentArchitecture())
  485. #define NewWECharByteProc(userRoutine) \
  486.     (WECharByteUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWECharByteProcInfo, GetCurrentArchitecture())
  487. #define NewWECharTypeProc(userRoutine) \
  488.     (WECharTypeUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWECharTypeProcInfo, GetCurrentArchitecture())
  489. #define NewWENewObjectProc(userRoutine) \
  490.     (WENewObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWENewObjectProcInfo, GetCurrentArchitecture())
  491. #define NewWEDisposeObjectProc(userRoutine) \
  492.     (WEDisposeObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEDisposeObjectProcInfo, GetCurrentArchitecture())
  493. #define NewWEDrawObjectProc(userRoutine) \
  494.     (WEDrawObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEDrawObjectProcInfo, GetCurrentArchitecture())
  495. #define NewWEClickObjectProc(userRoutine) \
  496.     (WEClickObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEClickObjectProcInfo, GetCurrentArchitecture())
  497. #define NewWEStreamObjectProc(userRoutine) \
  498.     (WEStreamObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEStreamObjectProcInfo, GetCurrentArchitecture())
  499.  
  500. #define CallWEClickLoopProc(we, userRoutine) \
  501.     CallUniversalProc((userRoutine), uppWEClickLoopProcInfo, (we))
  502. #define CallWEScrollProc(we, userRoutine) \
  503.     CallUniversalProc((userRoutine), uppWEScrollProcInfo, (we))
  504. #define CallWETSMPreUpdateProc(we, userRoutine) \
  505.     CallUniversalProc((userRoutine), uppWETSMPreUpdateProcInfo, (we))
  506. #define CallWETSMPostUpdateProc(we, fixLength, inputAreaStart, inputAreaEnd, pinRangeStart, pinRangeEnd, userRoutine) \
  507.     CallUniversalProc((userRoutine), uppWETSMPostUpdateProcInfo, (we), (fixLength), (inputAreaStart), (inputAreaEnd), (pinRangeStart), (pinRangeEnd))
  508. #define CallWETranslateDragProc(theDrag, theItem, requestedType, putDataHere, userRoutine) \
  509.     CallUniversalProc((userRoutine), uppWETranslateDragProcInfo, (theDrag), (theItem), (requestedType), (putDataHere))
  510. #define CallWEHiliteDropAreaProc(theDrag, hiliteFlag, we, userRoutine) \
  511.     CallUniversalProc((userRoutine), uppWEHiliteDropAreaProcInfo, (theDrag), (hiliteFlag), (we))
  512. #define CallWEDrawTextProc(pText, textLength, slop, styleRunPosition, we, userRoutine) \
  513.     CallUniversalProc((userRoutine), uppWEDrawTextProcInfo, (pText), (textLength), (slop), (styleRunPosition), (we))
  514. #define CallWEPixelToCharProc(pText, textLength, slop, pixelWidth, edge, styleRunPosition, hPos, we, userRoutine) \
  515.     CallUniversalProc((userRoutine), uppWEPixelToCharProcInfo, (pText), (textLength), (slop), (pixelWidth), (edge), (styleRunPosition), (hPos), (we))
  516. #define CallWECharToPixelProc(pText, textLength, slop, offset, direction, styleRunPosition, hPos, we, userRoutine) \
  517.     CallUniversalProc((userRoutine), uppWECharToPixelProcInfo, (pText), (textLength), (slop), (offset), (direction), (styleRunPosition), (hPos), (we))
  518. #define CallWELineBreakProc(pText, textLength, textStart, textEnd, textWidth, textOffset, we, userRoutine) \
  519.     CallUniversalProc((userRoutine), uppWELineBreakProcInfo, (pText), (textLength), (textStart), (textEnd), (textWidth), (textOffset), (we))
  520. #define CallWEWordBreakProc(pText, textLength, offset, edge, breakOffsets, script, we, userRoutine) \
  521.     CallUniversalProc((userRoutine), uppWEWordBreakProcInfo, (pText), (textLength), (offset), (edge), (breakOffsets), (script), (we))
  522. #define CallWECharByteProc(pText, textOffset, script, we, userRoutine) \
  523.     CallUniversalProc((userRoutine), uppWECharByteProcInfo, (pText), (textOffset), (script), (we))
  524. #define CallWECharTypeProc(pText, textOffset, script, we, userRoutine) \
  525.     CallUniversalProc((userRoutine), uppWECharTypeProcInfo, (pText), (textOffset), (script), (we))
  526. #define CallWENewObjectProc(defaultObjectSize, obj, userRoutine) \
  527.     CallUniversalProc((userRoutine), uppWENewObjectProcInfo, (defaultObjectSize), (obj))
  528. #define CallWEDisposeObjectProc(obj, userRoutine) \
  529.     CallUniversalProc((userRoutine), uppWEDisposeObjectProcInfo, (obj))
  530. #define CallWEDrawObjectProc(destRect, obj, userRoutine) \
  531.     CallUniversalProc((userRoutine), uppWEDrawObjectProcInfo, (destRect), (obj))
  532. #define CallWEClickObjectProc(hitPt, modifiers, clickTime, obj, userRoutine) \
  533.     CallUniversalProc((userRoutine), uppWEClickObjectProcInfo, (hitPt), (modifiers), (clickTime), (obj))
  534. #define CallWEStreamObjectProc(destKind, theType, putDataHere, obj, userRoutine) \
  535.     CallUniversalProc((userRoutine), uppWEStreamObjectProcInfo, (destKind), (theType), (putDataHere), (obj))
  536.  
  537. #else
  538.  
  539. typedef WEClickLoopProcPtr WEClickLoopUPP;
  540. typedef WEScrollProcPtr WEScrollUPP;
  541. typedef WETSMPreUpdateProcPtr WETSMPreUpdateUPP;
  542. typedef WETSMPostUpdateProcPtr WETSMPostUpdateUPP;
  543. typedef WETranslateDragProcPtr WETranslateDragUPP;
  544. typedef WEHiliteDropAreaProcPtr WEHiliteDropAreaUPP;
  545. typedef WEDrawTextProcPtr WEDrawTextUPP;
  546. typedef WEPixelToCharProcPtr WEPixelToCharUPP;
  547. typedef WECharToPixelProcPtr WECharToPixelUPP;
  548. typedef WELineBreakProcPtr WELineBreakUPP;
  549. typedef WEWordBreakProcPtr WEWordBreakUPP;
  550. typedef WECharByteProcPtr WECharByteUPP;
  551. typedef WECharTypeProcPtr WECharTypeUPP;
  552. typedef WENewObjectProcPtr WENewObjectUPP;
  553. typedef WEDisposeObjectProcPtr WEDisposeObjectUPP;
  554. typedef WEDrawObjectProcPtr WEDrawObjectUPP;
  555. typedef WEClickObjectProcPtr WEClickObjectUPP;
  556. typedef WEStreamObjectProcPtr WEStreamObjectUPP;
  557.  
  558. #define NewWEClickLoopProc(userRoutine) ((WEClickLoopUPP) (userRoutine))
  559. #define NewWEScrollProc(userRoutine) ((WEScrollUPP) (userRoutine))
  560. #define NewWETSMPreUpdateProc(userRoutine) ((WETSMPreUpdateUPP) (userRoutine))
  561. #define NewWETSMPostUpdateProc(userRoutine) ((WETSMPostUpdateUPP) (userRoutine))
  562. #define NewWETranslateDragProc(userRoutine) ((WETranslateDragUPP) (userRoutine))
  563. #define NewWEHiliteDropAreaProc(userRoutine) ((WEHiliteDropAreaUPP) (userRoutine))
  564. #define NewWEDrawTextProc(userRoutine) ((WEDrawTextUPP) (userRoutine))
  565. #define NewWEPixelToCharProc(userRoutine) ((WEPixelToCharUPP) (userRoutine))
  566. #define NewWECharToPixelProc(userRoutine) ((WECharToPixelUPP) (userRoutine))
  567. #define NewWELineBreakProc(userRoutine) ((WELineBreakUPP) (userRoutine))
  568. #define NewWEWordBreakProc(userRoutine) ((WEWordBreakUPP) (userRoutine))
  569. #define NewWECharByteProc(userRoutine) ((WECharByteUPP) (userRoutine))
  570. #define NewWECharTypeProc(userRoutine) ((WECharTypeUPP) (userRoutine))
  571. #define NewWENewObjectProc(userRoutine) ((WENewObjectUPP) (userRoutine))
  572. #define NewWEDisposeObjectProc(userRoutine) ((WEDisposeObjectUPP) (userRoutine))
  573. #define NewWEDrawObjectProc(userRoutine) ((WEDrawObjectUPP) (userRoutine))
  574. #define NewWEClickObjectProc(userRoutine) ((WEClickObjectUPP) (userRoutine))
  575. #define NewWEStreamObjectProc(userRoutine) ((WEStreamObjectUPP) (userRoutine))
  576.  
  577. #define CallWEClickLoopProc(we, userRoutine) \
  578.     (*(userRoutine))((we))
  579. #define CallWEScrollProc(we, userRoutine) \
  580.     (*(userRoutine))((we))
  581. #define CallWETSMPreUpdateProc(we, userRoutine) \
  582.     (*(userRoutine))((we))
  583. #define CallWETSMPostUpdateProc(we, fixLength, inputAreaStart, inputAreaEnd, pinRangeStart, pinRangeEnd, userRoutine) \
  584.     (*(userRoutine))((we), (fixLength), (inputAreaStart), (inputAreaEnd), (pinRangeStart), (pinRangeEnd))
  585. #define CallWETranslateDragProc(theDrag, theItem, requestedType, putDataHere, userRoutine) \
  586.     (*(userRoutine))((theDrag), (theItem), (requestedType), (putDataHere))
  587. #define CallWEHiliteDropAreaProc(theDrag, hiliteFlag, hWE, userRoutine) \
  588.     (*(userRoutine))((theDrag), (hiliteFlag), (hWE))
  589. #define CallWEDrawTextProc(pText, textLength, slop, styleRunPosition, we, userRoutine) \
  590.     (*(userRoutine))((pText), (textLength), (slop), (styleRunPosition), (we))
  591. #define CallWEPixelToCharProc(pText, textLength, slop, pixelWidth, edge, styleRunPosition, hPos, we, userRoutine) \
  592.     (*(userRoutine))((pText), (textLength), (slop), (pixelWidth), (edge), (styleRunPosition), (hPos), (we))
  593. #define CallWECharToPixelProc(pText, textLength, slop, offset, direction, styleRunPosition, hPos, we, userRoutine) \
  594.     (*(userRoutine))((pText), (textLength), (slop), (offset), (direction), (styleRunPosition), (hPos), (we))
  595. #define CallWELineBreakProc(pText, textLength, textStart, textEnd, textWidth, textOffset, we, userRoutine) \
  596.     (*(userRoutine))((pText), (textLength), (textStart), (textEnd), (textWidth), (textOffset), (we))
  597. #define CallWEWordBreakProc(pText, textLength, offset, edge, breakOffsets, script, we, userRoutine) \
  598.     (*(userRoutine))((pText), (textLength), (offset), (edge), (breakOffsets), (script), (we))
  599. #define CallWECharByteProc(pText, textOffset, script, we, userRoutine) \
  600.     (*(userRoutine))((pText), (textOffset), (script), (we))
  601. #define CallWECharTypeProc(pText, textOffset, script, we, userRoutine) \
  602.     (*(userRoutine))((pText), (textOffset), (script), (we))
  603. #define CallWENewObjectProc(defaultObjectSize, obj, userRoutine) \
  604.     (*(userRoutine))((defaultObjectSize), (obj))
  605. #define CallWEDisposeObjectProc(obj, userRoutine) \
  606.     (*(userRoutine))((obj))
  607. #define CallWEDrawObjectProc(destRect, obj, userRoutine) \
  608.     (*(userRoutine))((destRect), (obj))
  609. #define CallWEClickObjectProc(hitPt, modifiers, clickTime, obj, userRoutine) \
  610.     (*(userRoutine))((hitPt), (modifiers), (clickTime), (obj))
  611. #define CallWEStreamObjectProc(destKind, theType, putDataHere, obj, userRoutine) \
  612.     (*(userRoutine))((destKind), (theType), (putDataHere), (obj))
  613.  
  614. #endif
  615.  
  616.  
  617. /*    WASTE public calls */
  618.  
  619. /*    getting the shared library version number */
  620.  
  621. extern pascal NumVersion WEVersion(void);
  622.  
  623. /*    creation and destruction */
  624.  
  625. extern pascal OSErr WENew(const LongRect *destRect, const LongRect *viewRect, UInt32 flags, WEReference *we);
  626. extern pascal void WEDispose(WEReference we);
  627.  
  628. /*    getting variables */
  629.  
  630. extern pascal Handle WEGetText(WEReference we);
  631. extern pascal SInt16 WEGetChar(SInt32 offset, WEReference we);
  632. extern pascal SInt32 WEGetTextLength(WEReference we);
  633. extern pascal SInt32 WECountLines(WEReference we);
  634. extern pascal SInt32 WEGetHeight(SInt32 startLine, SInt32 endLine, WEReference we);
  635. extern pascal void WEGetSelection(SInt32 *selStart, SInt32 *selEnd, WEReference we);
  636. extern pascal void WEGetDestRect(LongRect *destRect, WEReference we);
  637. extern pascal void WEGetViewRect(LongRect *viewRect, WEReference we);
  638. extern pascal Boolean WEIsActive(WEReference we);
  639. extern pascal SInt32 WEOffsetToLine (SInt32 offset, WEReference we);
  640. extern pascal void WEGetLineRange(SInt32 lineNo, SInt32 *lineStart, SInt32 *lineEnd, WEReference we);
  641. extern pascal UInt16 WEGetClickCount(WEReference we);
  642.  
  643. /*    setting variables */
  644.  
  645. extern pascal void WESetSelection(SInt32 selStart, SInt32 selEnd, WEReference we);
  646. extern pascal void WESetDestRect(const LongRect *destRect, WEReference we);
  647. extern pascal void WESetViewRect(const LongRect *viewRect, WEReference we);
  648.  
  649. /*    accessing style run information */
  650.  
  651. extern pascal Boolean WEContinuousStyle(WEStyleMode *mode, TextStyle *ts, WEReference we);
  652. extern pascal void WEGetRunInfo(SInt32 offset, WERunInfo *runInfo, WEReference we);
  653.  
  654. /*    converting byte offsets to screen position and vice versa */
  655.  
  656. extern pascal SInt32 WEGetOffset(const LongPt *thePoint, WEEdge *edge, WEReference we);
  657. extern pascal void WEGetPoint(SInt32 offset, SInt16 direction, LongPt *thePoint, SInt16 *lineHeight, WEReference we);
  658.  
  659. /*    finding words and lines */
  660.  
  661. extern pascal void WEFindWord(SInt32 offset, WEEdge edge, SInt32 *wordStart, SInt32 *wordEnd, WEReference we);
  662. extern pascal void WEFindLine(SInt32 offset, WEEdge edge, SInt32 *lineStart, SInt32 *lineEnd, WEReference we);
  663.  
  664. /*    making a copy of a text range */
  665.  
  666. extern pascal OSErr WECopyRange(SInt32 rangeStart, SInt32 rangeEnd, Handle hText, StScrpHandle hStyles, WESoupHandle hSoup, WEReference we);
  667.  
  668. /*    getting and setting the alignment style */
  669.  
  670. extern pascal WEAlignment WEGetAlignment(WEReference we);
  671. extern pascal void WESetAlignment(WEAlignment alignment, WEReference we);
  672.  
  673. /*    recalculating line breaks, drawing and scrolling */
  674.  
  675. extern pascal OSErr WECalText(WEReference we);
  676. extern pascal void WEUpdate(RgnHandle updateRgn, WEReference we);
  677. extern pascal void WEScroll(SInt32 hOffset, SInt32 vOffset, WEReference we);
  678. extern pascal void WESelView(WEReference we);
  679.  
  680. /*    handling activate / deactivate events */
  681.  
  682. extern pascal void WEActivate(WEReference we);
  683. extern pascal void WEDeactivate(WEReference we);
  684.  
  685. /*     handling key-down events */
  686.  
  687. extern pascal void WEKey(SInt16 key, EventModifiers modifiers, WEReference we);
  688.  
  689. /*    handling mouse-down events and mouse tracking */
  690.  
  691. extern pascal void WEClick(Point hitPt, EventModifiers modifiers, UInt32 clickTime, WEReference we);
  692.  
  693. /*    adjusting the cursor shape */
  694.  
  695. extern pascal Boolean WEAdjustCursor(Point mouseLoc, RgnHandle mouseRgn, WEReference we);
  696.  
  697. /*    blinking the caret */
  698.  
  699. extern pascal void WEIdle(UInt32 *maxSleep, WEReference we);
  700.  
  701. /*    modifying the text and the styles */
  702.  
  703. extern pascal OSErr WEInsert(const void *pText, SInt32 textLength, StScrpHandle hStyles, WESoupHandle hSoup, WEReference we);
  704. extern pascal OSErr WEDelete(WEReference we);
  705. extern pascal OSErr WESetStyle(WEStyleMode mode, const TextStyle *ts, WEReference we);
  706. extern pascal OSErr WEUseStyleScrap(StScrpHandle hStyles, WEReference we);
  707. extern pascal OSErr WEUseText(Handle hText, WEReference we);
  708.  
  709. /*    undo */
  710.  
  711. extern pascal OSErr WEUndo(WEReference we);
  712. extern pascal void WEClearUndo(WEReference we);
  713. extern pascal WEActionKind WEGetUndoInfo(Boolean *redoFlag, WEReference we);
  714. extern pascal Boolean WEIsTyping(WEReference we);
  715.  
  716. /*    keeping track of changes */
  717.  
  718. extern pascal UInt32 WEGetModCount(WEReference we);
  719. extern pascal void WEResetModCount(WEReference we);
  720.  
  721. /*    embedded objects */
  722.  
  723. extern pascal OSErr WEInstallObjectHandler(FlavorType objectType, WESelector handlerSelector, UniversalProcPtr handler, WEReference we);
  724. extern pascal OSErr WEGetObjectHandler(FlavorType objectType, WESelector handlerSelector, UniversalProcPtr *handler, WEReference we);
  725. extern pascal OSErr WEInsertObject(FlavorType objectType, Handle objectDataHandle, Point objectSize, WEReference we);
  726. extern pascal OSErr WEGetSelectedObject(WEObjectReference *obj, WEReference we);
  727. extern pascal SInt32 WEFindNextObject(SInt32 offset, WEObjectReference *obj, WEReference we);
  728. extern pascal OSErr WEUseSoup(WESoupHandle hSoup, WEReference we);
  729.  
  730. /*    accessing embedded object attributes */
  731.  
  732. extern pascal FlavorType WEGetObjectType(WEObjectReference obj);
  733. extern pascal Handle WEGetObjectDataHandle(WEObjectReference obj);
  734. extern pascal Point WEGetObjectSize(WEObjectReference obj);
  735. extern pascal WEReference WEGetObjectOwner(WEObjectReference obj);
  736. extern pascal SInt32 WEGetObjectRefCon(WEObjectReference obj);
  737. extern pascal void WESetObjectRefCon(WEObjectReference obj, SInt32 refCon);
  738.  
  739. /*    clipboard operations */
  740.  
  741. extern pascal OSErr WECut(WEReference we);
  742. extern pascal OSErr WECopy(WEReference we);
  743. extern pascal OSErr WEPaste(WEReference we);
  744. extern pascal Boolean WECanPaste(WEReference we);
  745.  
  746. /*    Drag Manager support */
  747.  
  748. extern pascal RgnHandle WEGetHiliteRgn(SInt32 rangeStart, SInt32 rangeEnd, WEReference we);
  749. extern pascal OSErr WETrackDrag(DragTrackingMessage message, DragReference drag, WEReference we);
  750. extern pascal OSErr WEReceiveDrag(DragReference drag, WEReference we);
  751. extern pascal Boolean WECanAcceptDrag(DragReference drag, WEReference we);
  752. extern pascal Boolean WEDraggedToTrash(DragReference drag);
  753.  
  754. /*    Script Manager utilities */
  755.  
  756. extern pascal SInt16 WECharByte(SInt32 offset, WEReference we);
  757. extern pascal SInt16 WECharType(SInt32 offset, WEReference we);
  758.  
  759. /*    Text Services Manager support */
  760.  
  761. extern pascal OSErr WEInstallTSMHandlers(void);
  762. extern pascal OSErr WERemoveTSMHandlers(void);
  763. extern pascal void WEStopInlineSession(WEReference we);
  764.  
  765. /*    additional features */
  766.  
  767. extern pascal SInt16 WEFeatureFlag(SInt16 feature, SInt16 action, WEReference we);
  768. extern pascal OSErr WEGetInfo(WESelector selector, void *info, WEReference we);
  769. extern pascal OSErr WESetInfo(WESelector selector, const void *info, WEReference we);
  770.  
  771. /*    SInt32 coordinate utilities */
  772.  
  773. extern pascal void WELongPointToPoint(const LongPt *lp, Point *p);
  774. extern pascal void WEPointToLongPoint(Point p, LongPt *lp);
  775. extern pascal void WESetLongRect(LongRect *lr, SInt32 left, SInt32 top, SInt32 right, SInt32 bottom);
  776. extern pascal void WELongRectToRect(const LongRect *lr, Rect *r);
  777. extern pascal void WERectToLongRect(const Rect *r, LongRect *lr);
  778. extern pascal void WEOffsetLongRect(LongRect *lr, SInt32 hOffset, SInt32 vOffset);
  779. extern pascal Boolean WELongPointInLongRect(const LongPt *lp, const LongRect *lr);
  780.  
  781. #if PRAGMA_IMPORT_SUPPORTED
  782. #pragma import off
  783. #endif
  784.  
  785. #if PRAGMA_ALIGN_SUPPORTED
  786. #pragma options align=reset
  787. #endif
  788.  
  789. #ifdef __cplusplus
  790. }
  791. #endif
  792.  
  793. #endif    /* _WASTE_ */
  794.